<include file="Public/HOME/HTML/head_html_5.html" />
<meta charset="utf-8"/>
<title>我参与的活动{$Think.const.TITLE}</title>
<include file="Public/HOME/HTML/CssAndJs.html" />
<include file="Public/HOME/HTML/middle_list.html" />
<div class="row" style="height: 80%">
    <div class="col-lg-12" style="float: right">
        <div class="widget-container fluid-height clearfix">
            <div class="heading">
                <i class="icon-table"></i>我参与的活动
            </div>
            <div class="widget-content padded clearfix">
           
                <table class="table table-bordered table-striped dataTable" id="datatable-editable">
                    <thead>
                        <th style="width:15%;text-align: center">
                        活动名称
                        </th>
                        <th style="width:10%;text-align: center">
                          发布时间
                        </th>
                        <th style="width:10%;text-align: center;">
                         活动时间
                        </th>
                         <th style="width:10%;text-align: center">
                          结束时间
                        </th>
                        <th style="width:8%;text-align: center;">
                            活动地点
                        </th>
                        <th style="width:8%;text-align: center;">
                            票数/剩余票数
                        </th>
                           <th style="width:8%;text-align: center"class="sorting" role="columnheader" tabindex="0" aria-controls="datatable-editable" rowspan="1" colspan="1" aria-label="活动简述: activate to sort column ascending">
                          资料下载链接
                        </th>
                        <th style="width:8%;text-align: center;" class="sorting" role="columnheader" tabindex="0" aria-controls="datatable-editable" rowspan="1" colspan="1" aria-label="活动简述: activate to sort column ascending">
                            操作
                        </th>
                    </thead>
                    <tbody>
                    <volist name="list" id="vo">
                  
                            <tr>   
                           
                                <td style="text-align: center;">
                                    <a href="{$Think.const.DOMAIN_NAME}Home/Activity/details/aid/{$vo.aid}" target="_bank">{$vo.aname}</a>
                                </td>
                                 <td style="text-align: center;">
                                	  {$vo.adate}
                                </td>
                                <td style="text-align: center;">
                                    {$vo.startdate}
                                </td>
                                <td style="text-align: center;">
                                     {$vo.enddate}
                                </td>
                                 <td style="text-align: center;">
                                  	 {$vo.place}
                                </td>
                                 <td style="text-align: center;">
                                     {$vo.totalticket}/<span id="restticket">{$vo.restticket}</span>
                                </td> 
                                 <td style="text-align: center;">
                                     <a href="{:U('activity/download',array('aid'=>$vo['aid']))}" >{$vo.attach}</a>
                                </td>
                                <td style="text-align: center;">
                                 <input type="text" hidden=""  value="{$Think.session.userUid}">
                                 <input type="text" hidden="" value="{$vo.aid}">
                                <button  type="button" class="btn btn-danger" onclick="cancel(this)" id="cancel">取消抢票</button>
                                </td>
                            </tr>
                    </volist>
                    <script type="text/javascript">
                    function cancel(o){
                             var aid=$(o).prev().val();
                             var uid=$(o).prev().prev().val();
                             alert(uid+aid);
                              $.ajax({
                                 type:"get",
                                 url:"__CONTROLLER__/cancel/uid/"+uid+"/aid/"+aid,
                                 success:function(data){
                                    // alert(data);
                                   if(data) {
                                     alert("取消成功");
                                     $("#restticket").text(data);
                                     $("#invest").show();
                                     $("#cancel").hide();
                                   }
                                     else{
                                         alert("取消失败");
                                     }
                                 }
                               });
                    }
                       
                        </script>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- end DataTables Example -->
</div>
</div>
<include file="Public/HOME/HTML/footer.html" />
</body>
</html>